import config from '@/utils/config';
import { MockMethod } from 'vite-plugin-mock';

// 获取积分数量
const getCoinCount = {
  url: config.url.coin_num,
  method: 'get',
  response: () => {
    return {
      code: 200,
      data: '718',
      message: 'success',
    };
  },
};

// 获取积分明细
const getCoinList = {
  url: config.url.coin_list,
  method: 'post',
  response: () => {
    return {
      code: 200,
      data: [
        {
          id: 1,
          title: '每日打卡活动',
          changeCount: 5,
          changeType: 0,
          createTime: '2023年6月4日 10:48:34',
          createBy: '',
        },
        {
          id: 2,
          title: '每日打卡活动',
          changeCount: 5,
          changeType: 0,
          createTime: '2023年6月3日 10:48:34',
          createBy: '',
        },
        {
          id: 3,
          title: '订单20230602000001使用',
          changeCount: 100,
          changeType: 1,
          createTime: '2023年6月2日 11:48:34',
          createBy: '',
        },
        {
          id: 4,
          title: '每日打卡活动',
          changeCount: 5,
          changeType: 0,
          createTime: '2023年6月2日 10:48:34',
          createBy: '',
        },
        {
          id: 5,
          title: '每日打卡活动',
          changeCount: 5,
          changeType: 0,
          createTime: '2023年6月1日 10:48:34',
          createBy: '',
        },
        {
          id: 6,
          title: '每日打卡活动',
          changeCount: 5,
          changeType: 0,
          createTime: '2023年5月31日 10:48:34',
          createBy: '',
        },
        {
          id: 7,
          title: '幸运抽奖',
          changeCount: 15,
          changeType: 0,
          createTime: '2023年5月31日 10:31:30',
          createBy: '',
        },
        {
          id: 8,
          title: '幸运抽奖',
          changeCount: 10,
          changeType: 1,
          createTime: '2023年5月31日 10:31:20',
          createBy: '',
        },
        {
          id: 9,
          title: '购物返紫币',
          changeCount: 30,
          changeType: 0,
          createTime: '2023年5月30日 10:31:20',
          createBy: '',
        },
        {
          id: 10,
          title: '兑换优惠券100-5',
          changeCount: 100,
          changeType: 1,
          createTime: '2023年5月20日 10:31:20',
          createBy: '',
        },
      ],
      message: 'success',
    };
  },
};

// 获取签到数据
const getSignData = {
  url: config.url.coin_sign,
  method: 'get',
  response: () => {
    return {
      code: 200,
      data: {
        coinCount: 718,
        signDays: 520,
        signData: {
          sign_in_full: 7,
          sign_in_full_integral: 20,
          time: '2023-06-02 18:20:48',
          week: '周五',
        },
        signHis: [
          {
            signTime: '2023-05-29 10:00:00',
            signWeek: '周一',
            state: false,
            coinNum: 5,
          },
          {
            signTime: '2023-05-30 10:00:00',
            signWeek: '周二',
            state: true,
            coinNum: 6,
          },
          {
            signTime: '2023-05-29 10:00:00',
            signWeek: '周三',
            state: true,
            coinNum: 7,
          },
          {
            signTime: '2023-05-29 10:00:00',
            signWeek: '周四',
            state: false,
            coinNum: 8,
          },
          {
            signTime: '2023-05-29 10:00:00',
            signWeek: '周五',
            state: true,
            coinNum: 9,
          },
          {
            signTime: '2023-05-29 10:00:00',
            signWeek: '周六',
            state: false,
            coinNum: 10,
          },
          {
            signTime: '2023-05-29 10:00:00',
            signWeek: '周日',
            state: false,
            coinNum: 10,
          },
        ],
      },
      message: 'success',
    };
  },
};

// 保存签到数据
const saveSignData = {
  url: config.url.coin_sign_save,
  method: 'get',
  response: () => {
    return {
      code: 200,
      data: {
        coinCount: 728,
        signDays: 521,
        signData: {
          sign_in_full: 7,
          sign_in_full_integral: 20,
          time: '2023-06-03 18:20:48',
          week: '周六',
        },
        signHis: [
          {
            signTime: '2023-05-29 10:00:00',
            signWeek: '周一',
            state: false,
            coinNum: 5,
          },
          {
            signTime: '2023-05-30 10:00:00',
            signWeek: '周二',
            state: true,
            coinNum: 6,
          },
          {
            signTime: '2023-05-29 10:00:00',
            signWeek: '周三',
            state: true,
            coinNum: 7,
          },
          {
            signTime: '2023-05-29 10:00:00',
            signWeek: '周四',
            state: false,
            coinNum: 8,
          },
          {
            signTime: '2023-05-29 10:00:00',
            signWeek: '周五',
            state: true,
            coinNum: 9,
          },
          {
            signTime: '2023-05-29 10:00:00',
            signWeek: '周六',
            state: true,
            coinNum: 10,
          },
          {
            signTime: '2023-05-29 10:00:00',
            signWeek: '周日',
            state: false,
            coinNum: 10,
          },
        ],
      },
      message: 'success',
    };
  },
};

export default [getCoinCount, getCoinList, getSignData, saveSignData] as MockMethod[];
